<template>
	<view class="beijingse mainpadding2">
		<header-top :messageInfo="{typeFlag:true,message:'历史反馈',liner:false}"></header-top>
		<view class="kym" v-if="list.data.length == 0">
			<image src="../../static/image/system/zwfk.png" mode=""></image>
		</view>
		<view class="mainpadding ffffff radius margin_top" v-for="item in list.data" :key="item.id">
			<view class="flexbetween ">
				<view class="titletext">{{item.createtime_text}}</view>
				<view class="huangtext" v-show="item.status ==1">待处理</view>
				<view class="lvsetext" v-show="item.status ==2">已处理</view>
			</view>
			<view class="notitletext margin_top">{{item.des}}</view>
			<view class="flexleft margin_top" v-if="item.images.length">
				<view class="shillitu margin_right1" v-for="ite in item.images" :key="ite" >
					<image :src="ite" mode=""></image>
				</view>
			</view>
			<view class="flexleft margin_top" v-if="item.remarks">
				<view class="titletext">{{item.cltime_text}}回复：</view>
				<view class="titletext ">{{item.remarks}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
				tupian: {}
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this;
				httpRequest.request('api/user/getFeedbackList', 'POST', {
					page: page || 1,
					limit: _this.limit,
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						res.data.data.forEach(item => {
							Object.assign(item, {
								show: false
							})
							if(item.images){
								item.images = item.images.split(',')
							}else{
								item.images = []
							}
						})
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							// resList.data.images_text = resList.data.images_text.split(,)
							_this.list = resList
							_this.list.data = resList.data;
						}
						this.list.data.forEach(item=>{
							console.log(item.images,"当前数组")
							console.log(item.images.length,"当前数组长度")
						})
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.kym {
		margin: 250rpx auto 0;
		width: 319rpx;
		height: 267rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.shillitu {
		width: 134rpx;
		height: 128rpx;
		border-radius: 14rpx;

		image {
			width: 100%;
			height: 100%;
			border-radius: 14rpx;
		}
	}

	.lvsetext {
		font-size: 30rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #50B674;
	}

	.huangtext {
		font-size: 30rpx;
		font-family: PingFang SC-Heavy, PingFang SC;
		font-weight: 800;
		color: #FD463E;
	}
</style>
